#include <iostream>
#include <algorithm>
using namespace std;
using LL = long long;
const int N = 1e5 + 7;
int a[N];
int main() {
	freopen("duel.in", "r", stdin);
	freopen("duel.out", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	LL n, cnt = 0;
	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];
	sort(a+1, a+n+1);
	if (a[n]==a[1]) { cout << n; return 0; }
	for (int i = 1; i <= n; ++i) {
		if (a[i] != a[i+1])
			++cnt;
		if (a[i] == a[i+1]) break;
	}
	if (cnt == n) {
		if (n & 1) { cout << n-n/2; return 0; }
		else { cout << n / 2; return 0; } 
	}
	cnt = 0;
	int i = 1, j = 2;
	while (j <= n) {
		if (a[i] < a[j]) {
			++cnt;
			++i;
			++j;
		} else {
			++j;
		}
	}
	cout << n - cnt;
	return 0;
}
